package com.example.aopdemo.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
@Slf4j
@Aspect
//@Component
@Order(1)
public class AspectDemo4 {
    @Pointcut("execution(* com.example.aopdemo.controller.*.*(..))")
    public void pt(){};

    @Before("pt()")
    public void doBefore() {
        log.info("AspectDemo4执行doBefore....");
    }


    @After("pt()")
    public void doAfter() {
        log.info("AspectDemo4执行doAfter....");
    }
}